import { ref } from "vue";

import { getDeliverList } from "@/api/cloud";
import { DeliverInfo } from "@/types/index";

export default function UseDevelierList() {
  const deliversData = ref<DeliverInfo[]>([]);
  const loading = ref(false);

  getDeliverList().then((res) => {
    if (res.data && res.data.code === 200) {
      deliversData.value = res.data.result;
      loading.value = true;
    }
  });

  return { deliversData, loading };
}
